package com.demo.modules.system.controller;

import com.demo.common.security.annotation.InnerAuth;
import com.demo.common.core.result.R;
import com.demo.common.datasource.web.controller.BaseController;
import com.demo.modules.system.service.ISysConfigService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author MyPC
 */
@Api(tags = "C - 系统配置接口")
@RestController
@RequestMapping("/sys-config")
public class SysConfigController extends BaseController {

    @Autowired
    private ISysConfigService iSysConfigService;


    @InnerAuth
    @ApiOperation("根据参数键名查询参数值")
    @GetMapping("/configValue/{configKey}")
    public R<String> configKey(@PathVariable String configKey) {
        return R.ok(iSysConfigService.selectConfigByKey(configKey));
    }
}
